import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: 'Login',
    component:()=>import('../components/login/login.vue'),
  },
  {
    path: '/giao',
    name: 'Giao',
    component:()=>import('../components/giao.vue'),
  },
  {
    path: '/home',
    name: 'Home',
    redirect:"/introduce",
    component:()=>import('../components/home/home.vue'),
    children:[
      {
        path: '/introduce',
        name: 'Introduce',
        component:()=>import('../components/home/page/dashboard/introduce.vue'),
      },
      {
        path: '/dashboard',
        name: 'Dashboard',
        component:()=>import('../components/home/page/dashboard/dashboard.vue'),
      },
      {
        path: '/add',
        name: 'Add',
        component:()=>import('../components/home/page/dashboard/add.vue'),
      },

      // 首页配置
      {
        path: '/swiper',
        name: 'Swiper',
        component:()=>import('../components/home/page/homeconfig/swiper.vue'),
      },
      {
        path: '/hot',
        name: 'Hot',
        component:()=>import('../components/home/page/homeconfig/hot.vue'),
      },
      {
        path: '/new',
        name: 'New',
        component:()=>import('../components/home/page/homeconfig/new.vue'),
      },
      {
        path: '/recommend',
        name: 'Recommend',
        component:()=>import('../components/home/page/homeconfig/recommend.vue'),
      },
      // 模块管理
      {
        path: '/category',
        name: 'Category',
        component:()=>import('../components/home/page/modulemanage/category.vue'),
      },
      {
        path: '/good',
        name: 'Good',
        component:()=>import('../components/home/page/modulemanage/good.vue'),
      },
      {
        path: '/guest',
        name: 'Guest',
        component:()=>import('../components/home/page/modulemanage/guest.vue'),
      },
      {
        path: '/order',
        name: 'Order',
        component:()=>import('../components/home/page/modulemanage/order.vue'),
      },
      // 系统管理
      {
        path: '/account',
        name: 'Account',
        component:()=>import('../components/home/page/systemmanage/account.vue'),
      }
    ]
  }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router